﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Ext.Net.UIS.Script;


namespace Ext.Net.UIS
{


    #region Term с заранее определёнными tags

    public class Entity : Term
    {
        public Entity(string name) : base(name) { MakeEntity(); }
        public Entity(string name, params TermTag[] tags) : base(name, tags) { MakeEntity(); }
        public Entity(string name, params Term[] items) : base(name, items) { MakeEntity(); }
        public Entity(string name, TermTitle title) : base(name, title) { MakeEntity(); }
        public Entity(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { MakeEntity(); }
        public Entity(string name, TermTitle title, params Term[] items) : base(name, title, items) { MakeEntity(); }
    }

    public class Composite : Term
    {
        public Composite(string name) : base(name) { MakeComposite(); }
        public Composite(string name, params TermTag[] tags) : base(name, tags) { MakeComposite(); }
        public Composite(string name, params Term[] items) : base(name, items) { MakeComposite(); }
        public Composite(string name, TermTitle title) : base(name, title) { MakeComposite(); }
        public Composite(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { MakeComposite(); }
        public Composite(string name, TermTitle title, params Term[] items) : base(name, title, items) { MakeComposite(); }
    }

    public class Group : Term
    {
        public Group(string name) : base(name) { MakeGroup(); }
        public Group(string name, params TermTag[] tags) : base(name, tags) { MakeGroup(); }
        public Group(string name, params Term[] items) : base(name, items) { MakeGroup(); }
        public Group(string name, TermTitle title) : base(name, title) { MakeGroup(); }
        public Group(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { MakeGroup(); }
        public Group(string name, TermTitle title, params Term[] items) : base(name, title, items) { MakeGroup(); }
    }

    public class Row : Term
    {
        public Row(string name) : base(name) { MakeRow(); }
        public Row(string name, params TermTag[] tags) : base(name, tags) { MakeRow(); }
        public Row(string name, params Term[] items) : base(name, items) { MakeRow(); }
        public Row(string name, TermTitle title) : base(name, title) { MakeRow(); }
        public Row(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { MakeRow(); }
        public Row(string name, TermTitle title, params Term[] items) : base(name, title, items) { MakeRow(); }
    }


    public class Union : Term
    {
        public Union(string name) : base(name) { MakeUnion(); }
        public Union(string name, params TermTag[] tags) : base(name, tags) { MakeUnion(); }
        public Union(string name, params Term[] items) : base(name, items) { MakeUnion(); }
        public Union(string name, TermTitle title) : base(name, title) { MakeUnion(); }
        public Union(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { MakeUnion(); }
        public Union(string name, TermTitle title, params Term[] items) : base(name, title, items) { MakeUnion(); }
    }

    public class Label : Term
    {
        public Label(TermTitle title)
        {
            Title = title;
            MakeLabel();
        }
    }

    #endregion


    #region Term с заранее определёнными DataType

    public class Field<T> : Term
    {
        public Field() { }
        public Field(string name) : base(name, typeof(T)) { }
        public Field(string name, params TermTag[] tags) : base(name, typeof(T), tags) { }
        public Field(string name, params Term[] items) : base(name, typeof(T), items) { }
        public Field(string name, TermTitle title) : base(name, typeof(T), title) { }
        public Field(string name, TermTitle title, params TermTag[] tags) : base(name, typeof(T), title, tags) { }
        public Field(string name, TermTitle title, params Term[] items) : base(name, typeof(T), title, items) { }
    }

    public class Bool : Field<bool>
    {
        public Bool(string name) : base(name) { }
        public Bool(string name, params TermTag[] tags) : base(name, tags) { }
        public Bool(string name, TermTitle title) : base(name, title) { }
        public Bool(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Date : Field<DateTime>
    {
        public Date(string name) : base(name) { }
        public Date(string name, params TermTag[] tags) : base(name, tags) { }
        public Date(string name, TermTitle title) : base(name, title) { }
        public Date(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Int : Field<int>
    {
        public Int(string name) : base(name) { }
        public Int(string name, params TermTag[] tags) : base(name, tags) { }
        public Int(string name, TermTitle title) : base(name, title) { }
        public Int(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Text : Field<string>
    {
        public Text(string name) : base(name) { }
        public Text(string name, params TermTag[] tags) : base(name, tags) { }
        public Text(string name, TermTitle title) : base(name, title) { }
        public Text(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }


    public class Booln : Field<bool?>
    {
        public Booln(string name) : base(name) { }
        public Booln(string name, params TermTag[] tags) : base(name, tags) { }
        public Booln(string name, TermTitle title) : base(name, title) { }
        public Booln(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Daten : Field<DateTime?>
    {
        public Daten(string name) : base(name) { }
        public Daten(string name, params TermTag[] tags) : base(name, tags) { }
        public Daten(string name, TermTitle title) : base(name, title) { }
        public Daten(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Intn : Field<int?>
    {
        public Intn(string name) : base(name) { }
        public Intn(string name, params TermTag[] tags) : base(name, tags) { }
        public Intn(string name, TermTitle title) : base(name, title) { }
        public Intn(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    public class Textn : Field<string>
    {
        public Textn(string name) : base(name) { }
        public Textn(string name, params TermTag[] tags) : base(name, tags) { }
        public Textn(string name, TermTitle title) : base(name, title) { }
        public Textn(string name, TermTitle title, params TermTag[] tags) : base(name, title, tags) { }
    }

    #endregion



}
